import React, { Component } from 'react';
import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom'
import Home from '../pages/Home'
import CityList from '../pages/CityList'


export default class AppRouter extends Component {
  render() {
    return <div>
      <Router>
        <Routes>
          {/* 路由重定向 */}
          <Route path='/' element={<Navigate to='/home' />}></Route>
          <Route path='/home/*' element={<Home />}></Route>
          <Route path='/citylist' element={<CityList />}></Route>
        </Routes>
      </Router>
    </div>;
  }
}
